package com.luckeys.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.luckeys.dao.UserDao;
import com.luckeys.ios.vo.IosUserVO;
import com.luckeys.service.UserService;
import com.luckeys.vo.MessageVO;
import com.luckeys.vo.PageVO;
import com.luckeys.vo.UserVO;

@Service
public class UserServiceImpl implements UserService{

	@Autowired
	private UserDao userDao;
	
	public List<UserVO> queryUserList(UserVO user) {
		return userDao.queryUserList(user);
	}

	public UserVO queryUser(UserVO user) {
		return userDao.queryUser(user);
	}

	public PageVO<UserVO> queryUserPage(UserVO user) {
		PageVO<UserVO> page = new PageVO<UserVO>();
		page.setData(userDao.queryUserPage(user));
		page.setTotalRecords(userDao.queryUserCount(user));
		return page;
	}

	public int addUser(UserVO user) {
		return userDao.addUser(user);
	}

	public int deleteUser(String userUuid) {
		return userDao.deleteUser(userUuid);
	}

	public UserVO queryUserById(String userUuid) {
		return userDao.queryUserById(userUuid);
	}
	
	public IosUserVO queryIosUserById(String userUuid) {
		return userDao.queryIosUserById(userUuid);
	}

	public int updateUser(UserVO user) {
		return userDao.updateUser(user);
	}

	@Override
	public void addMessage(MessageVO message) {
		userDao.addMessage(message);
	}

	@Override
	public UserVO checkCodes(UserVO user) {
		return userDao.checkCodes(user);
	}

}
